package org.example.myleet.p1217;

public class Solution {
    public int minCostToMoveChips(int[] position) {
        long oddSum = 0, evenSum = 0;
        for (int coinIdx : position) {
            if ((coinIdx & 1) == 1) {
                ++oddSum;
            } else {
                ++evenSum;
            }
        }
        return (int) Math.min(oddSum, evenSum);
    }
}
